use warnings;
use Test::More 'no_plan';
use Inline C;

mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');

mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);
is(ed_scan_t(), 0, 'test mac_ed_scan()');
mac_init_t(0x0000);


#11
$pan_id = 0x1234;
mac_init_t($pan_id);
active_scan_t(1);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x2345;
mac_init_t($pan_id);
active_scan_t(2);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x3456;
mac_init_t($pan_id);
active_scan_t(3);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x5678;
mac_init_t($pan_id);
active_scan_t(1);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x6789;
mac_init_t($pan_id);
active_scan_t(1);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x7890;
mac_init_t($pan_id);
active_scan_t(2);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x8901;
mac_init_t($pan_id);
active_scan_t(3);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

$pan_id = 0x9012;
mac_init_t($pan_id);
active_scan_t(1);
is(get_bcn_frm_t(), 0, 'test mac_active_scan()');
is(get_pan_id_t(), $pan_id, 'test mac_active_scan()');

__END__


__C__

#include <stdio.h>
#include "../../../../mac/mac.h"

#include "mac_scan_test.c"
#include "../../../../mac/mac_scan.c"
#include "../../../../mac/mac_info.c"
#include "../../../../mac/mac_parse.c"
#include "../../stub/mac_rf_stub.c"
#include "../../stub/timer_stub.c"
#include "../../stub/mac_nhl_stub.c"
#include "../../../../mac/buf.c"
#include "../../../../mac/mem.c"
#include "../../../../mac/list.c"
#include "../../../../mac/mac_indir.c"
#include "../../../../mac/mac_retry.c"
#include "../../../../mac/mac_gen.c"
#include "../../../../mac/mac_tx.c"
#include "../../../../mac/mac_phy.c"
#include "../../../../mac/debug.c"

int mac_init_t(unsigned short pan_id)
{
    return mac_init_test(pan_id);
}

int ed_scan_t()
{
    MAC_DEBUG("ed_scan_t: 1\n");

    return mac_ed_scan_test();
}

int active_scan_t(unsigned char num)
{
    MAC_DEBUG("active_scan_t: \n");
    return mac_active_scan_test(num);
}

int get_bcn_frm_t()
{
    return get_bcn_frm_test();
}

int get_pan_id_t()
{
    return get_pan_id_test();
}


